<template>
	<view class="box">
		<view style="height: 20rpx;"></view>
		<view class="conter">
			<view style="padding: 20rpx;background: #FFF;border-radius: 10px;">
				<view v-if="activlist" style="height: 140px;display: flex;align-items: center;justify-content: center;">
					
				</view>
				<view v-else style="height: 140px;display: flex;align-items: center;justify-content: center;">
					<!-- <u-icon name="gift" te></u-icon> -->
                    <u-empty text="奖品筹备中" mode="list" width="68rpx" height="68rpx" iconColor="#ffd600" icon="https://env-00jxh6fq2eto.normal.cloudstatic.cn/2025/05/19/20957731-81984739-0.png"></u-empty>
				</view>
			</view>
			<view style="color: #333;font-size: 28rpx;margin: 20rpx;">
				往期抽奖
			</view>
			<view v-if="videolist.length>=1" style="display: flex;align-items: center;justify-content: space-between;flex-wrap: wrap;">
			  <view v-for="(i,e) in videolist" :key="i._id">
			  		<button @navigatetovideoview="navigatetovideoview"  open-type="navigateToVideoView" :data-video-id="i.videoId" :style="{background:'url('+i.cover_url+') no-repeat 0 0/ 100% 100%'}" style="margin-bottom: 20rpx;width: 348rpx;height: 416rpx;border-radius: 20rpx;display: flex;flex-direction: column;justify-content: space-between;padding: 10rpx;">
			  		<view style="display: flex;justify-content: space-between;align-items: center;">
			  			<view>
			  				<view></view>
			  				<view><u-rate :count="getnum(i.num)" activeColor="#fdc64d" :size="18" :value="getnum(i.num)"></u-rate></view>
			  			</view>
			  			<view style="font-size: 24rpx;color: #fff;font-weight: 500;text-align: right;">
			  			<view>{{i.km}}km</view>
			  			<view>{{i.city}}·{{i.district}}</view>
			  			</view>
			  		</view>
			  		</button>
			  	</view>
			</view>
			<view  v-else>
				<u-empty text="暂无活动" mode="list" ></u-empty>
			</view>
		</view>
		<!-- <u-swiper
		    :list="list4"
		    keyName="url"
		    :autoplay="false"
			height="720"
		    ></u-swiper> -->
	</view> 
</template>

<script>
	export default {
		data() {
			return {
				videolist:[],
				activlist:null,
				   list4: [{
				     url: 'https://mp-a6a84ef0-b508-435d-8a4b-c9dd12d10ee0.cdn.bspapp.com/cloudstorage/3f3943e90b8ef395d53b06e852ed2d1d.mp4',
				     poster: 'https://mp-a6a84ef0-b508-435d-8a4b-c9dd12d10ee0.cdn.bspapp.com/微信图片_20240405205055.jpg'
				 }],
				formdata:{
					pageSize:20,
					pageNum:1
				} 
			}
		},
		onReady() {
			// setTimeout(()=>{
			// 	this.bindtap()
			// },30000)
		},
		onLoad() {
			this.getprizelist()
		},
		methods: {
			async getprizelist(){
				const res = await this.$http.post('/nav/getprizelist',this.formdata)
				if(res.errCode==200){
					this.videolist =[...this.videolist,...res.data]
					this.videolist = this.videolist.filter(item => item.videoId);
				}
			},
			bindtap(){
				this.interstitialAd = tt.createInterstitialAd({
				  adUnitId: "9qh6tot7yjdfj9uuim",
				});
				this.interstitialAd
				  .load()
				  .then(() => {
					console.log("广告显示成功");
				    this.interstitialAd.show();
				  })
				  .catch((err) => {
				    console.log(err);
				  });
			},
		}
	}
</script>

<style scoped lang="scss">
.box{
	width: 100vw;
	height: 100vh;
	background: linear-gradient(to bottom, #ffd600, #ffffff);
	.conter{
		width: 95%;
		margin: 0 auto;
		// background-color: #fff;
		
	}
}
</style>
